Skip to content

feat(bruno): add a yml format for OpenCollection collections - #21

Merged
mvantellingen merged 1 commit into
mainfrom
feat/bruno-opencollection-format
Nov 23, 2026
Merged

mvantellingen merged 1 commit into
mainfrom
feat/bruno-opencollection-format

Conversation

@mvantellingen

Copy link
Copy Markdown
Member

Why

A Bruno collection in the OpenCollection format (an opencollection.yml in its root, requests as .yml) does not load .bru files. The plugin only wrote .bru, so in such a collection the generated requests were on disk but never showed up in Bruno.

What

  • New option format: "bru" | "yml", default bru — existing users get the same output.
  • yml writes each operation as an OpenCollection GraphQL request: info (name, type, seq per folder), graphql (method, url, headers, body.query, body.variables) and auth (none is omitted, inherit as-is, any other mode as { type }). Strings are written as JSON (valid YAML double-quoted scalars) and the query/variables as block scalars, so no YAML dependency is added to the plugin.
  • clean now removes previously generated requests of both formats (.bru and .yml, except folder.bru / folder.yml), so switching format leaves no stale requests behind.
  • README and a minor changeset.

Testing

  • New tests: YAML snapshots, a parse of the output (url, auth, headers with quotes, query, variables), auth modes, and clean removing a stale .yml under the default format. The new tests fail without the index.ts change.
  • Ran it against a real project (143 operations) with format: "yml": every file parses as YAML, its query parses as GraphQL and its variables as JSON; the old .bru files were cleaned up.
  • Not checked: opening the output in the Bruno app itself.

A Bruno collection with an opencollection.yml does not load .bru files, so
the generated requests did not show up in it. format: "yml" writes them as
OpenCollection requests instead; the default stays bru. clean now removes
generated requests of both formats, so switching leaves none behind.
@mvantellingen
mvantellingen enabled auto-merge (rebase) November 23, 2026 16:06
@mvantellingen
mvantellingen merged commit 088c755 into main Nov 23, 2026
5 checks passed
@mvantellingen
mvantellingen deleted the feat/bruno-opencollection-format branch November 23, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant